{
    /*创建*/
    let arr1 = Array.of(1, 2, 3);
    console.log("arr1", arr1);
    /*批量修改*/
    console.log("arr2", Array.from(arr1, function (item) {
        return item * 2;
    }));//修改每一个值

    console.log("arr3", arr1.fill(6));
    let arr4 = [1, 2, 3];
    console.log("arr4", arr4.fill(6, 0, 2));//替换值

    let arr5 = [1, 2, 3, 4];
    console.log("arr5", arr5.copyWithin(0, 2, 4));//替换值,输出[3 4 3 4]
}
{
    /*遍历*/
    for (let item of ['a', 'b', 'c']) {
        console.log(item);
    }//默认找值
    for (let item of ['a', 'b', 'c'].keys()) {
        console.log(item);
    }//遍历下标
    for (let item of ['a', 'b', 'c'].values()) {
        console.log(item);
    }//遍历值
    for (let [key, value] of ['a', 'b', 'c'].entries()) {
        console.log(key, value);
    }//同时遍历值和下标

}
{
    /*查找*/
    let arr = [1, 2, 3, 4];
    console.log(arr.find(function (target) {
        return target>2;
    }));//返回要找的target
    console.log(arr.findIndex(function (target) {
        return target>2;
    }));//返回要找的target的下标
    console.log([1,'s',NaN].includes(1));//返回boolean
    console.log([1,'s',NaN].includes(NaN));
}